package com.godyao.mall.core.model;

import cn.hutool.core.util.StrUtil;
import cn.hutool.db.Page;
import lombok.Data;

import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;

/**
 * @author godyao
 * @date 2022/4/5
 */
@Data
public class EsSearchParam extends Page {
    private String keyword;

    public String getKeyword() {
        if (StrUtil.isNotBlank(keyword)) {
            return URLDecoder.decode(keyword, StandardCharsets.UTF_8);
        }
        return keyword;
    }
}
